A file conversion method and apparatus

ABSTRACT

The present invention relates to a method for converting an image file or document file into a drawing file including the steps of extracting an outline from an image of a subject file to be drafted; detecting corner feature points from the image of the subject file to be drafted based on the extracted outline to coordinate the corner feature points into outer edge coordinate information and connecting the detected corner feature points with a line to generate a first image; removing the outline from the image of the subject file to be drafted and detecting one or more elements to coordinate the elements into element coordinate information and generating a second image including the one or more detected elements; template matching by superimposing the generated first image and second image; and generating a drawing file for the subject file to be drafted by using the outer edge coordinate information and element coordinate information.

BACKGROUND OF THE INVENTION 1. Field of the invention

The present invention to a method and apparatus for converting an imageor document file into a drawing file.

2. Description of the Related Art

Generally, when designing a drawing, a CAD program is installed in apersonal computer or a notebook computer or the like, a figure is drawnusing a device such as a mouse or a tablet, and the result iscalculated.

The calculated design drawing (DWG, DXF) can be opened by anothercomputer using a CAD program, and a new design drawing can be calculatedthrough editing such as modification.

In addition, if the calculated design drawing is converted into an imagefile (JPG file, GIF file, PNG file, etc.) or a PDF file, the image filecan be viewed using another view program, but it is impossible to usethe image file again.

That is, when a design drawing is converted into an image file, it isimpossible to reuse the design drawing.

On the other hand, the conventional technology for converting a filesuch as an image file back to a CAD drawing is an electronic pencombined with a mouse that interlocks with CAD, or a system thatgenerates, stores, and records CAD files automatically anytime andanywhere desirable to the user without being limited by time and spaceon the web, wherein a pen-shaped optical mouse capable of simultaneousCAD control and handwriting input is used, and a user can create animage and drawing file (DWG, DXF) just with a sketch, which is recordedin a storage device (memory) inside the pen. In addition, just by theuser inputting handwriting, it can be created into a file of TEXT typeand it is also possible to make it into a drawing in a TEXT (character)form of CAD to store.

However, the above-described conventional technology has a disadvantagein that it is impossible to reuse an image file because the image filecannot be converted into a design drawing. Further, the conventionaltechnology for automatically generating a CAD drawing using a digitalelectronic pen mouse is inconvenient in that a user must do thesketching him/herself or manually read the design drawing with a digitalelectronic pen mouse.

SUMMARY OF THE INVENTION

It is an object of the present invention to provide a file conversionmethod and apparatus that makes an image file or a document file into adrawing to allow use thereof.

According to an aspect of the present invention, there is provided afile conversion method including converting an image file or a documentfile into a drawing file and extracting an outline from an image of asubject file to be drafted; detecting corner feature points from theimage of the subject file to be drafted based on the extracted outlineto coordinate the corner feature points into outer edge coordinateinformation and connecting the detected corner feature points with aline to generate a first image; removing the outline from the image ofthe subject file to be drafted and detecting one or more elements tocoordinate the elements into element coordinate information andgenerating a second image including the one or more detected elements;template matching by superimposing the generated first image and secondimage; and generating a drawing file for the subject file to be draftedby using the outer edge coordinate information and element coordinateinformation.

A file conversion apparatus according to an embodiment of the presentinvention includes an input unit for receiving a subject file to bedrafted; an image processing unit for extracting an outline from animage of the subject file to be drafted, detecting corner feature pointsfrom the image of the subject file to be drafted based on the extractedoutline to coordinate the corner feature points into outer edgecoordinate information and connecting the detected corner feature pointswith a line to generate a first image, removing the outline from theimage of the subject file to be drafted and detecting one or moreelements to coordinate the elements into element coordinate informationand generating a second image including the one or more detectedelements, template matching by superimposing the generated first imageand second image, and then generating a drawing file for the subjectfile to be drafted by using the outer edge coordinate information andelement coordinate information; and a storage unit for storing thegenerated drawing file.

Meanwhile, the file conversion method may be embodied as acomputer-readable recording medium on which a program for execution by acomputer is recorded.

In addition, a program for executing the file conversion method on acomputer may be installed in a terminal device according to anembodiment of the present invention.

According to an embodiment of the present invention, various image filesand document files can be converted into drawing files without manualoperation of the user, so image or document files can be easily drawnand reused by an automatic program.

According to another embodiment of the present invention, byimplementing an indoor 3D drawing and object information as an augmentedreality based on actual measurement information, it is possible toimplement augmented reality more realistically and to designate anobject generation position of the augmented reality, thereby allowingthe object to be easily placed without actual 3D drawing information.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 is a block diagram showing a schematic configuration of a fileconversion apparatus according to an embodiment of the presentinvention.

FIG. 2 is a block diagram showing an embodiment of the configuration ofthe image file processing unit shown in FIG. 1.

FIG. 3 is a flowchart illustrating a file conversion method according toan embodiment of the present invention.

FIGS. 4 to 7 are views for explaining an embodiment of a method ofdrafting an image file.

FIG. 8 is a block diagram illustrating a configuration of an augmentedreality-based object generation apparatus according to anotherembodiment of the present invention.

FIG. 9 is a block diagram showing an embodiment of the configuration ofa control unit shown in FIG. 8.

FIG. 10 is a diagram for explaining an embodiment of a method ofdetecting a user position.

FIG. 11 is a flowchart illustrating a method of generating an augmentedreality-based object according to another embodiment of the presentinvention.

DETAILED DESCRIPTION OF THE INVENTION

Hereinafter, embodiments of the present invention will be described indetail with reference to the accompanying drawings.

The various embodiments described below may be implemented in arecording medium readable by a computer or similar device usingsoftware, hardware, or a combination thereof.

In accordance with a hardware implementation, embodiments of the presentinvention may be implemented using at least one of, application specificintegrated circuits (ASICs), digital signal processors (DSPs), digitalsignal processing devices (DSPDs), programmable logic devices (PLDs),field programmable gate arrays (FPGAs), processors, controllers,micro-controllers, microprocessors, and electrical units for performingfunctions.

On the other hand, according to a software implementation, embodimentssuch as procedures or functions may be implemented with separatesoftware modules that perform at least one function or operation.Software codes may be implemented by a software application written inan appropriate programming language.

Further, the software codes may be stored in a memory of variousterminal devices such as a mobile phone, a smart phone, a laptopcomputer, a desktop personal computer (PC), and the like.

FIG. 1 is a block diagram illustrating a configuration of a fileconversion apparatus according to an embodiment of the presentinvention. The illustrated file conversion apparatus includes an inputunit 10, an image file processing unit 20, and a storage unit 30.

Referring to FIG. 1, the input unit 10 is a part for inputting a file tobe drafted, that may be implemented as a USB port for receiving a filebeing input through an external device or a. communication module forinputting or downloading a file through a network. Here, the file fordrafting may include at least one of an image file (JPG file, GIF file,PNG file, etc.) and a PDF file. The PDF file may refer to a file imagedthrough its own algorithm.

Meanwhile, the image file processing unit 20 plays the role of draftingthe file input through the input unit 10 and saving the file in thestorage unit 30.

As shown in FIG. 2, the image file processing unit 20 includes anoutline extraction module 21 for extracting an outline from an inputfile, a corner feature point detection module 22 for detecting a cornerfeature point based on the extracted outline, a point connection module23 for connecting the detected corner feature points with a line, anoise removal module 24 for removing noise from the connected lines, animage detection module 25 for detecting an image from which an outeredge is removed, a template matching module 26 for template matching thenoise-removed image and the outer edge-removed image, a 2D drawinggeneration module 27 for generating a 2D drawing for an input file byapplying stored outer edge coordinate information and element coordinateinformation to a CAD program, and a 3D drawing calculation module 28 forcalculating a 3D drawing based on the generated 2D drawing.

A file conversion method according to an embodiment of the presentinvention extracts an outline from an image of a subject file to bedrafted, detects corner feature points from the image of the subjectfile to be drafted based on the extracted outline to coordinate thecorner feature points into outer edge coordinate information andconnects the detected corner feature points with a line to generate afirst image.

Further, the method removes the outline from the image of the subjectfile to be drafted and detects one or more elements to coordinate theelements into element coordinate information and generate a second imageincluding the one or more detected elements.

In addition, the method performs template matching by superimposing thegenerated first image and second image and then generates a drawing filefor the subject file to be drafted by using the outer edge coordinateinformation and element coordinate information.

For example, the subject file to be drafted may include at least one ofa JPG file, a GIF file, a PNG file, and a PDF file.

Meanwhile, the outline extracting step may convert the image of the fileto be drafted into gray scale, truncate codes the image converted intogray scale to obtain the most significant bit information, and applies amedian filter to the most significant bit information for smoothing out,to allow the outline to be extracted. Here, the most significant bitinformation obtaining step may use bit-plane slicing.

The first image generating step may detect a corner image from theoutline-extracted image by using Harris corner detection and may detectthe corner feature points using the detected corner image. The firstimage may be noise-removed.

The second image generating step may detect an outline by obtaininginformation on a linear component significant in the noise-removed firstimage, and may detect an element including at least one of a door, awindow and a washbasin from which the detected outline is removed.

Further, the template matching step may template-match the first andsecond images with priority on at least one of a door, a window, and awashbasin.

Meanwhile, the element coordinate information detects a position valueof the detected element, and may be obtained by calculating a positionvalue of the outline-removed image and detected element.

The drawing file generation step generates a 2D drawing by applying theouter edge coordinate information and the element coordinate informationto a CAD program, and a 3D drawing file may be generated based on thegenerated drawing file.

FIG. 3 is a flowchart illustrating a file conversion method according toan exemplary embodiment of the present invention, wherein a method ofdrafting an image file such as a JPG file, a GIF file, or a PNG file, ora document file such as a PDF file into a file that can be used such asa CAD file.

Referring to FIG. 3, a file conversion method according to an embodimentof the present invention includes: (a) receiving a subject file to bedrafted in step S101; (b) extracting an outline from the input file insteps S102 to S104; (c) detecting corner feature points based on theextracted outline to make into coordinates in step S105; (d) connectingthe detected corner feature points with a line in step S106; (e)removing noise from the lines connected in the step (d), in step S107;(f) detecting an image from which an outline has been removed from theinput file in step S108; (g) template matching the noise-removed imagein step (e) and the image detected in step (f), in step S109; (h) afterthe template matching in step (g), generating a 2D drawing for the inputfile by applying the stored outer edge coordinate information andelement coordinate information to the CAD program in step S110; (i)calculating a 3D drawing based on the 2D drawing generated in step (h),in step S111.

Meanwhile, step (b) may include the steps of: (b1) converting the inputimage file information into gray scale in step S102; (b2) truncationcoding by bit-plane slicing the information converted into gray scale,storing the most significant bit information image among the truncationcoded information, using a median filter to smooth out the truncationcoded information to extract the outline and storing the resultant imagein steps S103 to S104.

In step (f), information about a linear component which is significantin the noise-removed image is stored, the converted gray scale image andmedian filter may be used for smoothing out and an outline-extractedimage may be calculated to allow the detection of an image from which anouter edge has been removed.

In step (h), the position value of the element matched in the templatematching is stored, the element coordinate information is extracted bycalculating the image finished with detecting the outer edge and theposition value of the stored element, and the outer edge coordinateinformation and the element coordinate information are applied to a CADprogram and an input file (image file, PDF file) can be 2D drafted.

Hereinafter, a file conversion method according to an embodiment of thepresent invention will be described in detail.

First, a subject file to be drafted is inputted through the input unit10 in step S101, Here, the file to be drafted includes at least one ofan image file (JPG file, GIF file, PNG file, etc.) and a PDF file. FIG.4 is an exemplary diagram showing a case where an input file is an imagefile.

When the image file is inputted, the image file processing unit 20processes the inputted image file and drafts it.

For example, the input image file information is converted into grayscale (image I) in step S102. A digital image refers to an image inwhich the value of each pixel is one sample, and can only transmitinformation of luminosity. Such kind of image, also known as black andwhite, consists of gray shadows, ranging from “black” of the lightestluminous intensity to “white” of the strongest luminous intensity.Therefore, the brightness of each pixel can he determined by convertingimage file information to gray scale.

Next, the image information converted into gray scale istruncation-coded by a bit-plane slicing method. That is, losscompression is performed.

For example, one pixel of an 8-bit gray image is composed of 8 bits, andthe most significant hit among the 8 bits is called MSB and the leastsignificant bit is called LSB. The lower 4 bits are truncated to performloss compression.

Thereafter, the most significant hit information image (image 2) of thetruncation-coded information is stored in the storage unit 30, thetruncation-coded information is smoothed using a median filter toextract an outline, and the resultant image (image 3) is stored.

Here, the smoothing using the median filter means that the intensity ofeach pixel is replaced with the intermediate value of the intensity oflight in the surrounding points of the pixel instead of an averagevalue. This smoothing method is particularly effective when the noiseform is strong and consists of elements such as elongated lines, andcorner sharpening is well preserved through such a smoothing method.

FIG. 4 shows an example of an image file to be converted into a drawingfile by the file conversion method according to the present invention,and FIG. 5 shows an example of a result of extracting an outline fromthe image file shown in FIG. 4.

Next, in step S105, corner feature points are detected based on theextracted outline and are converted into coordinates.

FIG. 6 shows an example of the result of extracting corner featurepoints from the image file.

For example, with the information of the outline-extracted image, acorner image (image 4) is detected through Harris corner detection, andthe outline-detected image (image 3) and corner image (image 4) arecalculated to allow detection of the corner feature points.

Here, the Harris corner detection is an algorithm that recognizes pointsas corner points (corner) where change is occurred in all directions,not when there is no change in all directions or when changes occur onlyin a constant direction following an edge, when an arbitrary region(window) is generated in the image and searched.

Next, in step S106, the detected corner feature points are connectedwith a line (image 5). Thereafter, noise is removed from the connectedlines in step S107.

For example, an image from which the outline is detected (image 3) andan image where the corner feature points are connected by lines (image5) may be calculated (logical AND) and the noise on the lines may beremoved.

Next, in step S108, an image where the outer edge has been removed fromthe image file is detected.

For example, it is possible to store information about significantlinear components in a noise-free image, and to detect elements in animage where outer edge detecting is finished (image 6).

Here, the element may mean an image, not an outline in the image file asshown in FIG. 4. For example, a door, a window, a washbasin, and thelike can be elements.

Then, the converted gray scale image (image 1) and the median filter areused for smoothing, and the outline-extracted image (image 3) iscalculated and an image from which an outer edge is removed may bedetected.

Thereafter, in step S109, the image from which noise is removed and theimage from which an element is detected are subjected to templatematching.

FIG. 7 shows an example of a template-matching state between anoise-removed image and an element-detected image.

For example, the noise-removed image and the element-detected image canbe superimposed.

Here, the template matching may be template matching having a door, awindow, a washbasin as priority.

Next, after template matching in step S110, outer edge coordinateinformation and the element coordinate information previously stored maybe applied to a CAD program to generate a 2D drawing for the input file.

For example, the position value of the matched element in the templatematching is stored (image 7), the image finished with outer edgedetection (image 6) and the position value of the stored element (image7) is calculated to extract element coordinate information, and theouter edge coordinate information and element coordinate information areapplied to a CAD program so that an image file may be 2D drafted.

Then, in step S111, a 3D drawing is calculated based on the generated 2Ddrawing. Here, a method of calculating a 2D drawing into a 3D drawingcan be performed using Rhino, 3D MAX, AutoCAD, ArchiCAD program, or thelike.

According to an embodiment of the present invention as described above,an image file such as a JPG file, a GIF file, or a PNG file, or adocument file such as a PDF file, can be drafted, making it possible toreuse an image file, and it can be more convenient to use by drafting byan automatic program without manual operation of the user.

Meanwhile, the 3D drawing converted by the file conversion methodaccording to an embodiment of the present invention as described abovecan be used to implement an augmented reality.

For example, a specific object may be implemented as an augmentedreality on a 3D drawing converted from an image file or a document file,thereby facilitating the placement of objects and the like.

According to another embodiment of the present invention, it is possibleto implement object information as an augmented reality on a 3D drawinggenerated based on actual measurement information, thereby enabling theimplementation of a more realistic augmented reality, and also designatean object generation position of augmented reality so that it ispossible to easily place the object without the actual measured 3Ddrawing information.

Hereinafter, an augmented reality-based object generating apparatus andmethod according to another embodiment of the present invention will bedescribed in detail with reference to FIG. 8 through FIG. 11.

FIG. 8 is a block diagram illustrating a configuration of an augmentedreality-based object generating apparatus through actual measurementaccording to another embodiment of the present invention, wherein theaugmented reality-based object generating apparatus includes a camera101, an image processing unit 102, a 3D conversion unit 103, a distancemeasurement unit 104, an angle measurement unit 105, a control unit 106,a storage unit 107, a display unit 108, an input unit 109, and a frameforming unit 110.

Referring to FIG. 8, the camera 101 plays a role of acquiring an imageof an actual indoor space, a shipbuilding, a plant, an automobile, amedia, a game, etc. for generating an object to implement an augmentedreality, and the image processing unit 102 plays the role of processingthe image obtained by the camera 101 using an ordinary image processingtechnique.

Here, the subject for implementing augmented reality may be various suchas an indoor space, a shipbuilding, a plant, an automobile, a media, agame and the like, and the methods for implementing the augmentedreality are all the same, so hereinafter for convenience purposes,details on only the indoor space will be described.

On the other hand, the camera 101 can use a plurality of cameras or apanoramic camera to enable the acquirement of 3D images.

The distance measuring unit 104 measures the distance to the subject tobe measured, wherein an infrared sensor, an ultrasonic sensor, or thelike can be used. To measure the distance, infrared or ultrasonic wavesare emitted to the measurement object and the reflected signal isprocessed to measure the distance.

The frame forming unit 110 forms a surface by connecting a plurality ofposition information using the distance measured by the distancemeasuring unit 104 as position information, and based on the formedsurface information, forms an indoor frame corresponding to the actualindoor space.

The 3D conversion unit 103 may be used to draft the actual indoor imageprocessed by the image processing unit 102 or the indoor frame imageformed from the frame forming unit 110 using a drawing program.

Meanwhile, the 3D conversion unit 103 may process an image file or adocument file using the file conversion method according to anembodiment of the present invention as described with reference to FIGS.1 to 7, and convert the image file or the document file into a 3Ddrawing.

The angle measuring unit 105 measures an angle of the camera 101, forexample, a photographing angle of the smartphone, when photographing theobject to be measured. The angle measuring unit 105 may be implementedusing a geomagnetic sensor, a gyro sensor, acceleration sensor or thelike mounted on an ordinary smartphone.

The storage unit 107 performs the role of storing the 3D drawinggenerated by measuring an indoor space and stores distance and angleinformation of the indoor position. According to the control of thecontrol unit 106, the display unit 108 plays the role of superimposingthe specific object at a corresponding position of the indoor drawingdisplayed on camera view to display the object as an augmented reality.

In addition, the input unit 109 may receive operation information to beoperated by a user, and may transmit the received operation informcontrol unit 106.

The control unit 106 maps the drawing converted by the 3D conversionunit 103, the distance value measured by the distance measuring unit 104and the angle value measured by the angle measuring unit 105, and storesit in the storage unit 107, and when the user selects a specific object,the selected specific object may be implemented as augmented reality ona 3D drawing designed based on the actual measurement.

As shown in FIG. 9, the control unit 106 includes a 3D drawingextracting unit 111 for extracting a 3D drawing stored in a storageunit, a designated position coordinate value extracting unit 112 forextracting a coordinate value of a position designated by the user onthe 3D drawing, a distance and angle information detecting unit 113 fordetecting a distance and an angle of an actual position corresponding tothe designated position, a user position calculating unit 114 fordetecting a position of the user, an object generating unit 116 forgenerating an object at a corresponding position of the camera based onthe detected user position, a 3D drawing coordinate adjusting unit 115for re-adjusting the coordinates of the 3D drawing corresponding to theuser position calculated by the user position calculating unit 114 to beresponsive to the movement of a camera view, and an information inputmodule 117 for receiving operation information of the user.

The user position calculating unit 114 processes the coordinate value ofthe 3D drawing designated by the user and the coordinate value of theactual position corresponding to the 3D drawing designated by the userwith a trigonometric function to compute the current user position onthe basis of the origin coordinate at the time the 3D drawing was made.

The configuration and operation of the augmented reality-based objectgenerating apparatus through actual measurement will be described indetail below.

First, in order to generate an object based on an augmented reality, anactual indoor space for implementing an augmented reality isphotographed through a camera 101 to obtain an indoor image, or anindoor frame image corresponding to an actual indoor space is acquiredthrough a frame forming unit 110.

For example, when the camera 101 is used, a plurality of cameras may beused or a panoramic camera may be used.

The frame forming unit 110 obtains a plurality of distance values(position coordinates) with respect to the measurement object (indoorwall surface) measured in conjunction with the distance measuring unit104, and the plurality of position coordinates are connected with a lineto form a surface. Then, each of the surfaces is combined into a frameto form an indoor frame that is identical to the actual indoor space.Here, the frame refers to a wall surface structure in which a wallstructure of an actual indoor space is formed through positioncoordinates.

The image processing unit 102 can process the indoor image acquired bythe camera 101 using an ordinary image processing technique.

Meanwhile, the 3D conversion unit 103 performs drafting of the actualindoor image processed by the image processing unit 102 or the frameformed by the frame forming unit 110 into 3D using a drawing program(for example, a CAD program). Here, the photographed indoor image may bedrafted into 2D to be used.

The distance measuring unit 104 measures a distance of a measurementobject (a specific position indoors) by using a distance measuringmethod using an infrared sensor, an ultrasonic sensor or a laserpointer.

Further, the angle measuring unit 105 may measure the angle of thecamera 101, for example, photographing angle of a smartphone, whencapturing the image of the measurement object using a geomagneticsensor, a gyro sensor, an acceleration sensor, and the like that ismounted on an ordinary smartphone.

The control unit 106 maps the distance measurement information and theangle measurement information to the 3D drawing information generatedthrough the 3D conversion unit 103 and stores the mapping information inthe storage unit 107.

Then, when a user selects a specific object through the camera of thesmartphone, that is, photographs a specific object (for example,furniture to be placed indoors, shipbuilding, plant, automobile, media,game, etc.), the distance information of the specific object and thecamera, photographing angle information of the camera, and the like arecalculated and stored.

Next, when the user selects a 3D drawing for the actual indoor spacestored in the storage unit 107, the 3D drawing extraction unit 111extracts the 3D drawing stored in the storage unit 107 and displays iton a screen.

When the user designates a specific position in a state that the 3Ddrawing of the indoor space is displayed on the screen, the designatedposition coordinate value extraction unit 112 extracts the coordinatevalue for the designated position.

Here, since the coordinate values for each position are generated andstored when the indoor photographed image is produced in the 3D drawing,the coordinate value for the designated position can quickly be quicklyextracted as soon as the user designates the position.

Then, the distance and the angle of the actual position corresponding tothe 3D plane specified by the distance and angle information detectingunit 113 are calculated. For example, when photographing through acamera in an actual indoor space, distance information between thecamera and a specific position in the actual indoor space, and thephotographing angle of the camera and such are calculated.

Next, the user position calculation unit 114 detects the position of theuser based on the calculated information. For example, the user positioncalculation unit 114 processes the coordinate values of the 3D drawingdesignated by the user and the coordinate values of the actual positionscorresponding to the 3D drawing designated by the user using thetrigonometric function as shown in FIG. 10, to allow the calculation ofthe current user position based on the origin coordinate at the time the3D drawing was produced.

Thereafter, the 3D drawing coordinate adjusting unit 115 adjusts thecoordinates of the 3D drawing corresponding to the user positioncalculated by the user position calculating unit 114 to react to themovement of the camera view.

For example, motion vectors are obtained in response to a user's angleand motion using a geomagnetism sensor, a gyro sensor, an accelerationsensor and such of a smartphone, and the coordinate values of the 3Ddrawing are readjusted based on the motion vector thus calculated so thecoordinates where the object is to be placed may be calculated. That is,the generation position of the object to be generated as the augmentedreality is designated.

Next, the object generating unit 116 generates an object at acorresponding position of the camera based on the detected userposition, and implements the object as an augmented reality.

FIG. 11 is a flowchart illustrating a method of generating an augmentedreality-based object through actual measurement according to anotherembodiment of the present invention.

Referring to FIG. 11, an augmented reality-based object generatingmethod includes the steps of: (a) drafting and storing 3D views of animage obtained to implement an augmented reality using a drawing programin steps S1101 to S1103; (b) extracting a coordinate value of a positiondesignated by a user in the stored 3D drawing in steps S1104 to S1105;(c) calculating a distance and an angle of an actual indoor positioncorresponding to the designated position in step S1106; (d) calculatinga position of the current user in step S1107; (e) calculating a motionvector according to the user position calculated in the step (d), andadjusting the coordinates of the 3D drawing using the calculated motionvector to react to movement of the camera view in steps S1108 to S1109;(f) outputting a 3D view to the camera view and generating an object ata corresponding position of the camera to implement an augmented realityin steps S1110 to S1113.

The step (d) of step S1107 processes the coordinate value of the 3Ddrawing designated by the user and the coordinate value of the actualposition corresponding to the 3D drawing designated by the user with atrigonometric function to determine the current user position based onthe origin coordinate at the time the 3D drawing was produced.

Meanwhile, step (e) may include the steps of (e1) calculating a distanceand angle to a point in the actual indoor space in which the objectselected by the user is to be placed in step S1111, (e2) calculatingobject placement coordinates based on the current position in stepS1112, (e3) calculating a corresponding position of the camera based onthe object placement coordinates, and generating an object as anaugmented reality at the corresponding position of the camera in stepS1113.

More specifically, in step S1101, to generate an object based on anaugmented reality, an actual indoor space for implementing an augmentedreality is photographed through a camera 101 to acquire an indoor image,or an indoor frame image can be formed corresponding to the actualindoor space through a frame forming unit 110.

For example, when the camera 101 is used, a plurality of cameras may beused or a panoramic camera may be used.

The frame forming unit 110 obtains a plurality of distance values(position coordinates) with respect to the measurement object (indoorwall surface) measured in conjunction with the distance measuring unit104, and the plurality of position coordinates are connected with a lineto form a surface. Then, each of the surfaces is combined into a frameto form an indoor frame that is identical to the actual indoor space.

Here, the frame refers to a wall surface structure in which a wallstructure of an actual indoor space is formed through positioncoordinates.

In step S1102, the image processing unit 102 processes the acquiredimage using an ordinary image processing technique. Then, the 3Dconversion unit 103 drafts the actual indoor image processed by theimage processing unit 102 in 3D using a drawing program (CAD program).Here, the photographed indoor image may be drafted to be used as 2D.

At this time, the distance measuring unit 104 measures the distance of ameasurement object (a specific position in the indoor space) using adistance measuring method using an infrared sensor, an ultrasonicsensor, or a laser pointer, and transmits the measured distance to thecontroller 106.

Further, the angle measuring unit 105 may measure the angle of thecamera 101, for example, photographing angle of a smartphone, whencapturing the image of the measurement object using a geomagneticsensor, a gyro sensor, an acceleration sensor, and the like that ismounted on an ordinary smartphone.

The control unit 103 maps the distance measurement information and theangle measurement information to the 3D drawing information generatedthrough the 3D conversion unit 103 and may store the mapping informationin the storage unit 107 in step S1103.

Then, when a user selects a specific object through the camera of thesmartphone, that is, photographs a specific object (for example,furniture to be placed indoors), the distance information of thespecific object and the camera, photographing angle information of thecamera, and the like are calculated and stored.

Next, when the user selects a 3D drawing for the actual indoor spacestored in the storage unit 107, the 3D drawing extraction unit 111extracts the 3D drawing stored in the storage unit 107 and displays iton a screen in step S1104.

in addition, when the user designates a specific position in a statethat the 3D drawing of the indoor space is displayed on the screen, thedesignated position coordinate value extraction unit 112 extracts thecoordinate value for the designated position in step S1105.

Here, since the coordinate values for each position are generated andstored when the indoor photographed image is produced in the 3D drawing,the coordinate value extraction can quickly extract the coordinatevalues for designated position as soon as the user designates theposition.

Then, in step S1106 the distance and the angle of the actual positioncorresponding to the 3D plane specified by the distance and angleinformation detecting unit 113 are calculated. For example, whenphotographing through a camera in an actual indoor space, distanceinformation between the camera and a specific position in the actualindoor space, and the photographing angle of the camera and such arecalculated.

Next, in step S1107 the user position calculation unit 114 detects theposition of the user based on the calculated information. For example,the user position calculation unit 114 processes the coordinate valuesof the 3D drawing designated by the user and the coordinate values ofthe actual positions corresponding to the 3D drawing designated by theuser using the trigonometric function as shown in FIG. 10, to allow thecalculation of the current user position based on the origin coordinateat the time the 3D drawing was produced.

Thereafter, in step S1108 and step S1109 the 3D drawing coordinateadjusting unit 115 adjusts the coordinates of the 3D drawingcorresponding to the user position calculated by the user positioncalculating unit 114 to react to the movement of the camera view. Forexample, motion vectors are obtained in response to a user's angle andmotion using a geomagnetic sensor, a gyro sensor, and an accelerationsensor of a smartphone, and the coordinate values of the 3D drawing arereadjusted based on the motion vector thus calculated, to calculate thecoordinates to place the object. That is, the generation position of theobject to be generated as the augmented reality is designated.

Next, in steps S1110 to S1113 the object generating unit 116 generatesan object at a corresponding position of the camera based on thedetected user position, and implements the object as an augmentedreality.

For example, the 3D view is output to the camera view in step S1110 andthe distance and angle to the point where the object (e.g., furniture)is to be placed is calculated in step S1111. Thereafter, in step S1112,the object placement coordinates are calculated based on the currentposition. In step S1113, an object (e.g., furniture) is generated at acorresponding position of the camera, and the object is displayedthrough the augmented reality.

The above-described methods according to the present invention can bestored in a computer-readable recording medium made of a program forexecution on a computer. Examples of the computer-readable recordingmedium include a ROM, a RAM, a CD-ROM, a floppy disk, an optical datastorage device, and the like, and may also be implemented in the form ofa carrier wave (for example, transmission over the Internet).

The computer readable recording medium may be distributed over networkedcomputer systems so that computer readable code in a distributed mannercan be stored and executed. In addition, functional programs, codes andcode segments for implementing the above method can be easily inferredby programmers of the technical field to which the present inventionbelongs.

Meanwhile, the program for executing the methods according to thepresent invention may be installed in a terminal device according to anembodiment of the present invention, and may be a file conversion methodaccording to an embodiment of the present invention, or an augmentedreality-based object generation method that can be performed in aterminal device in which the program is installed.

Further, while the present invention has been particularly shown anddescribed with reference to exemplary embodiments thereof, it is to beunderstood that the invention is not limited to the disclosed exemplaryembodiments, but, on the contrary, it will be understood by thoseskilled in the art that various changes in form and details may be madetherein without departing from the spirit and scope of the presentinvention.

INDUSTRIAL APPLICABILITY

The present invention is applied to a technique of drafting a file, forexample, in various industrial fields such as a construction of a 3Dindoor space, a plant, a 3D indoor space information business, a spatialinformation business, and a 3D indoor map construction business and thelike.

Further, the present invention can be applied to a technique forgenerating objects such as furniture, shipbuilding, plants, media,automobiles, games and the like through the augmented realitytechnology.

1. A method for converting an image file or document file into a drawingfile comprising, extracting an outline from an image of a subject fileto be drafted; detecting corner feature points from the image of thesubject file to be drafted based on the extracted outline to coordinatethe corner feature points into outer edge coordinate information andconnecting the detected corner feature points with a line to generate afirst image; removing the outline from the image of the subject file tobe drafted and detecting one or more elements to coordinate the elementsinto element coordinate information and generating a second imageincluding the one or more detected elements; template matching bysuperimposing the generated first image and second image; and generatinga drawing file for the subject file to be drafted by using the outeredge coordinate information and element coordinate information.
 2. Amethod of claim 1, wherein the subject file to be drafted comprises atleast one of a JPG file, a GIF file, a PNG file, and a PDF file.
 3. Amethod of claim 1, wherein the outline extracting step comprises thesteps of, converting the image of the subject file to be drafted intogray scale; truncate coding the image converted into gray scale toobtain the most significant bit information; and extracting the outlineby applying a median filter to the most significant bit information forsmoothing out.
 4. The method of claim 3, wherein the most significantbit information obtaining step uses bit-plane slicing.
 5. The method ofclaim 1, wherein the first image generating step comprises, detecting acorner image from the outline-extracted image by using Harris cornerdetection; and detecting the corner feature points using the detectedcorner image.
 6. The me 1, wherein the step of removing noise from thefirst image is further comprised.
 7. The method of claim 6, wherein thesecond image generating step comprises, detecting an outline byobtaining information on a linear component significant in thenoise-removed first image; and detecting an element comprising at eastone of a door, a window and a washbasin from which the detected outlineis removed.
 8. The method of claim 1, wherein the template matching steptemplate-matches the first and second images with priority on at leastone of a door, a window, and a washbasin.
 9. The method of claim 1,wherein the element coordinate information detects a position value ofthe detected element, and is obtained by calculating a position value ofthe outline-removed image and detected element.
 10. The method of claim1, wherein the drawing file generation step comprises generating a 2Ddrawing by applying the outer edge coordinate information and theelement coordinate information to a CAD program.
 11. The method of claim1, further comprising the step of generating a 3D drawing file based onthe generated drawing file.
 12. A recording medium on which a programfor causing a computer to execute the method of claim 1 is recorded. 13.A terminal device in which a program for executing the method of claim 1is installed in a computer.
 14. An apparatus for converting an imagefile or document file into a drawing file comprising, an input unit forreceiving a subject file to be drafted; an image processing unit forextracting an outline from an image of the subject file to be drafted,detecting corner feature points from the image of the subject file to bedrafted based on the extracted outline to coordinate the corner featurepoints into outer edge coordinate information and connecting thedetected corner feature points with a line to generate a first image,removing the outline from the image of the subject file to be draftedand detecting one or more elements to coordinate the elements intoelement coordinate information and generating a second image includingthe one or more detected elements, template matching by superimposingthe generated first image and second image, and then generating adrawing file for the subject file to be drafted by using the outer edgecoordinate information and element coordinate information; and a storageunit for storing the generated drawing file.